package Review05;

public class Penguin extends Pet{
    private String sex;

    public Penguin() {
    }

    public Penguin(String name, int health, int love, String sex) {
        super(name, health, love);
        this.sex = sex;
    }

    @Override
    public void print() {
        super.print();
        System.out.println("性别"+this.sex);
    }

    @Override
    public void gotoHospital() {
        System.out.println("带企鹅去医院");
    }

    public void swim(){
        System.out.println("带企鹅去游泳");
    }
    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }
}
